#ifndef __RELAY_H__
#define __RELAY_H__
#include "gd32f10x.h"

/* Relay ID */
#define RELAY_WIND_L            0
#define RELAY_WIND_M            1
#define RELAY_WIND_H            2
#define RELAY_VALVE             3
#define RELAY_NUM               4    

typedef struct 
{
    uint8_t id;
    uint8_t state;
    uint32_t gpio_periph;
    uint32_t pin;
}Relay;

void relay_init(void);
void relay_set(uint8_t relayId, uint8_t state);
uint8_t get_relay_state(uint8_t relayId);

#endif
